﻿using Autofac;
using Castle.DynamicProxy;
using System;
using System.Collections.Generic;
using System.Text;
using Truron.Purchase.Utility;

namespace Truron.Purchase.Service
{
    /// <summary>
    /// autofac  IOC依赖注入
    /// </summary>
    public class CustomAutofacAop : IInterceptor
    {
        public void Intercept(IInvocation invocation)
        {
            //LogHelper.Info($"方法{invocation.Method}执行前调用了"); 
            //LogHelper.Info($"方法传入参数{string.Join(",", invocation.Arguments)}");
            // invocation.Proceed()前，指实际方法调用前执行
            invocation.Proceed(); //继续执行
            // invocation.Proceed()后，指实际方法调用后执行
            //LogHelper.Info($"方法{invocation.Method}执行后调用了");
        }
    }
}
